package com.summer.main;

public class CommonDivisor {
	
	public static void main(String[] args) {
		System.out.println(""+commonDivisor(181818,272727));
	}
	
	public static int commonDivisor(int number1,int number2){
		System.out.println(number1+"   "+number2);
		int maxNumber = Math.max(number1, number2);
		int minNumber = Math.min(number1, number2);
		int remainde = maxNumber % minNumber;
		int res = minNumber;
		if(remainde!=maxNumber)
			res = commonDivisor(remainde,minNumber);
		return res;
	}
	
}
